<template>
  <div class="re-main chart-full">
    <header-bar></header-bar>
    <div class="chart-full" style="display: flex; height: calc(100% - 64px); overflow-y: hidden">
      <menu-panel :menuList="menuList" v-on:choose-menu="chooseMenu"></menu-panel>
      <div style="position: relative; height: 100%; width: calc(100% - 200px)">
        <div class="chart-full">aaa</div>
      </div>
    </div>
  </div>
</template>

<script>
import HeaderBar from '../components/HeaderBar';
import MenuPanel from '../components/MenuPanel';

export default {
  name: 'PageOuter',
  components: { HeaderBar, MenuPanel },
  data() {
    return {
      menuList: [
        {
          id: '1',
          name: '应用分析',
          subList: [],
        },
      ],
      panelExtStatus: 'normal',
      loaded: false,
    };
  },
  methods: {
    chooseMenu(paramObj) {
      if (this.$route.name !== paramObj.id) {
        this.$router.push({
          name: paramObj.id,
        });
      }
    },
    initFrame(pid) {
      let menuObj = this.menuList[0].subList[0];
      if (pid !== 'default') {
        menuObj =
          this.menuList[0].subList.find(item => {
            return item.id === pid;
          }) || this.menuList[0].subList[0];
      }

      this.chooseMenu(menuObj);
    },
  },

  mounted() {
    this.initFrame(this.$route.name);
  },
};
</script>

<style scoped>
</style>
